package com.mallcloud.mall.app.controller;

import com.mallcloud.mall.app.service.AppOrderCouponService;
import com.mallcloud.mall.common.core.util.R;
import com.mallcloud.mall.mall.api.entity.MallOrderCouponModel;
import com.mallcloud.mall.mall.service.MallOrderCouponService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "app-券订单")
@RestController
@AllArgsConstructor
@RequestMapping("/app/orderCoupon")
public class AppOrderCouponController {
	private final MallOrderCouponService mallOrderCouponService;
	private final AppOrderCouponService appOrderCouponService;

	@ApiOperation("新增")
	@PostMapping("/save")
	public R<Boolean> save(@RequestBody MallOrderCouponModel orderModel) {
		return R.ok(mallOrderCouponService.save(orderModel));
	}

	@ApiOperation("支付取消")
	@PostMapping("/cancel")
	public R<Boolean> cancel(@RequestBody MallOrderCouponModel orderModel) {
		return R.ok(appOrderCouponService.cancel(orderModel));
	}

}
